Component({
  properties: {
    isCanDraw: {
      type: Boolean,
      value: !1,
      observer: function (t) {
        t && this.handleStartDrawImg();
      },
    },
    content: "",
  },
  data: { imgDraw: {}, sharePath: "" },
  methods: {
    handleStartDrawImg: function () {
      wx.showLoading({ title: "生成中" }),
        this.setData({ imgDraw: this.data.content });
    },
    onImgErr: function (t) {
      wx.hideLoading(),
        wx.showToast({ title: "生成分享图失败，请刷新页面重试" }),
        this.triggerEvent("initData");
    },
    onImgOK: function (t) {
      wx.hideLoading(),
        wx.showShareImageMenu({
          path: t.detail.path,
          fail: function (t) {
            console.log(t);
          },
        }),
        this.triggerEvent("initData");
    },
  },
});
